load("@io_bazel_rules_go//go:def.bzl", "go_library", "go_test")

package(
    default_visibility = ["//visibility:public"],
    licenses = ["notice"],  # Apache 2.0
)

go_library(
    name = "go_default_library",
    srcs = [
        "server.go",
    ],
    importpath = "github.com/google/cel-go/server",
    deps = [
        "//cel:go_default_library",
        "//common/types:go_default_library",
        "//common/types/ref:go_default_library",
        "@com_google_cel_spec//proto/test/v1/proto2:test_all_types_go_proto",
        "@com_google_cel_spec//proto/test/v1/proto3:test_all_types_go_proto",
        "@org_golang_google_genproto_googleapis_api//expr/conformance/v1alpha1:go_default_library",
        "@org_golang_google_genproto_googleapis_api//expr/v1alpha1:go_default_library",
        "@org_golang_google_genproto_googleapis_rpc//code:go_default_library",
        "@org_golang_google_genproto_googleapis_rpc//status:go_default_library",
        "@org_golang_google_protobuf//proto:go_default_library",
        "@org_golang_google_protobuf//types/known/anypb:go_default_library",
    ],
)

go_test(
    name = "go_default_test",
    srcs = ["server_test.go"],
    args = ["$(location //server/main:cel_server)"],
    data = ["//server/main:cel_server"],
    rundir = ".",
    visibility = ["//visibility:public"],
    deps = [
        ":go_default_library",
        "//checker/decls:go_default_library",
        "//common/operators:go_default_library",
        "//test:go_default_library",
        "@com_google_cel_spec//tools/celrpc:go_default_library",
        "@org_golang_google_genproto_googleapis_api//expr/conformance/v1alpha1:go_default_library",
        "@org_golang_google_genproto_googleapis_api//expr/v1alpha1:go_default_library",
        "@org_golang_google_genproto_googleapis_rpc//status:go_default_library",
    ],
)
